let is_open = false


let toggle_btn = document.getElementsByClassName('toggle_btn')[0]

let close_btn = document.getElementsByClassName('close')[0]

let main = document.getElementsByClassName('main')[0]

let nav = document.getElementsByClassName('nav')[0]


toggle_btn.onclick = function() {
    if (is_open) {
        this.style.transform = `rotate(0deg)`
        close_btn.style.left = '-50%'
        main.classList.remove('rotate')
        nav.classList.remove('show')
    } else {
        this.style.transform = `rotate(-70deg)`
        close_btn.style.left = '25%'
        main.classList.add('rotate')
        setTimeout(() => {
            nav.classList.add('show')
        }, 500);

    }


    is_open = !is_open
}